{% extends "index.html" %}
<head>

    <script>
    function check(){
        var money = document.getElementById("money").value;
        var user_account = document.getElementById("user_account").value;
        console.log(1)
        console.log(money)
        console.log(user_accounty)
        console.log(2)
        if(Number(money) > Number(user_account)){
            alert("账户余额不足");
            return false;
        }else {
            alert("正在进行打赏");
            return true;
        }
    }
</script>
</head>
{% block body %}
    {% block header %}
        {{ super() }}
    {% endblock %}

    {% block error_404 %}
        <!-- Main Content -->

        <main id="main-content">
            <form action="{{ url_for('user.donate_function') }}" method="post" onsubmit="return check();">
                <div class="main-section">
                    <div class="page-section">
                        <div class="container">
                            <div class="row">
                                <div class="section-fullwidth col-lg-12">
                                    <div class="cs-content-holder">
                                        <div class="row">
                                            <div class="col-lg-12">
                                                <div class="page-not-found" >
                                                    <div class="col-lg-4" >
                                                        <div class="price-box mt-4" >
                                                            <div class="pricing-badge">
                                                                <span class="badge">为它筹集</span>
                                                            </div>
                                                            <h4 class="pricing-title mb-0">Starter</h4>
                                                            <input type="number" name="money" required="required" id="money" placeholder="请输入整数金额"><sup
                                                                class="text-muted f-15"></sup> <i style="size: legal">
                                                            ￥</i>
                                                            <input type="hidden" name="function_id"
                                                                   value="{{ function_id }}">
                                                            <input type="hidden" value="{{ user_account }}" name="user_account" id="user_account">
                                                            <p class="text-muted mt-3 pb-3">你的善举会带给别人极大的帮助
                                                            </p>
                                                            <hr class="mt-3 pricing-active-color">
                                                            <div class="price-features mt-4 pt-3">
                                                                <p class="text-muted"><i
                                                                        class="mdi mdi-check-circle text-primary f-17 me-2"></i><span
                                                                        class="text-dark fw-normal">20,000</span> people
                                                                </p>
                                                                <p class="text-muted"><i
                                                                        class="mdi mdi-check-circle text-primary f-17 me-2"></i><span
                                                                        class="text-dark fw-normal">30,000</span> ￥</p>
                                                                <p class="text-muted"><i
                                                                        class="mdi mdi-check-circle text-primary f-17 me-2"></i><span
                                                                        class="text-dark fw-normal">1,100</span> Cases
                                                                </p>
                                                                <p class="text-muted"><i
                                                                        class="mdi mdi-check-circle text-primary f-17 me-2"></i><span
                                                                        class="text-dark fw-normal">Email</span> 1 Year
                                                                    trail</p>
                                                                <p class="text-muted"><i
                                                                        class="mdi mdi-check-circle text-primary f-17 me-2"></i><span
                                                                        class="text-dark fw-normal">Free domain</span>
                                                                    annual plan</p>
                                                            </div>
                                                            <div>
                                                                <input type="submit" class="btn btn-primary w-100"
                                                                       value="Start with Donate">
                                                            </div>
                                                        </div>
                                                    </div>
                                                </div>
                                            </div>
                                        </div>
                                    </div>
                                </div>
                            </div>
                        </div>
                    </div>
                </div>
            </form>
        </main><!--// Main Content //-->
        {% block register %}
            {{ super() }}
        {% endblock %}
        {% block footer %}
            {{ super() }}
        {% endblock %}

        {% block copyright %}
            {{ super() }}
        {% endblock %}
    {% endblock %}
{% endblock %}
